<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">

	<ui:define name="body">

		<rich:panel>
			<f:facet name="header">User Details</f:facet>

			<s:decorate id="id" template="layout/display.xhtml">
				<ui:define name="label">Id</ui:define>
				<h:outputText value="#{userController.user.id}" />
			</s:decorate>

			<s:decorate id="firstName" template="layout/display.xhtml">
				<ui:define name="label">First name</ui:define>
				<h:outputText value="#{userController.user.firstName}" />
			</s:decorate>

			<s:decorate id="lastName" template="layout/display.xhtml">
				<ui:define name="label">Last name</ui:define>
				<h:outputText value="#{userController.user.lastName}" />
			</s:decorate>

			<s:decorate id="userName" template="layout/display.xhtml">
				<ui:define name="label">User name</ui:define>
				<h:outputText value="#{userController.user.userName}" />
			</s:decorate>

			<s:decorate id="password" template="layout/display.xhtml">
				<ui:define name="label">Password</ui:define>
				<h:outputText value="#{userController.user.password}" />
			</s:decorate>

			<div style="clear: both" />

		</rich:panel>

		<div class="actionButtons">
		<s:button 
			action="#{userController.prepareEdit}" 
			view="/UserEdit.xhtml"
			id="edit" value="Edit">
			<f:param name="userFrom" value="user" />
		</s:button>
		
		<s:button 
			view="/#{(empty userFrom || userFrom eq 'User') ? 'UserList' : userFrom}.xhtml"
			action="#{userController.cancelAndList}" 
			id="done" 
			value="Done" />
		</div>

	</ui:define>

</ui:composition>
